package com.rain.shoppingscienceproj.utils.layoutmanager;

import android.content.Context;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.util.AttributeSet;

/**
 * Author: Rain
 * Create: 2018/3/29 11:35
 */

public class CusStaggeredGridLayoutManager extends StaggeredGridLayoutManager {
    private boolean isScrollEnabled = false;

    public void setScrollEnabled(boolean flag) {
        this.isScrollEnabled = flag;
    }

    public CusStaggeredGridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    public CusStaggeredGridLayoutManager(int spanCount, int orientation) {
        super(spanCount, orientation);
    }

    @Override
    public boolean canScrollVertically() {
        return isScrollEnabled && super.canScrollVertically();
    }
}
